package com.bbcare.followup.plat.service.impl;

import com.bbcare.followup.plat.entity.DumpPlanUpload;
import com.bbcare.followup.plat.service.IDumpMessageRecordService;
import com.bbcare.followup.plat.service.IDumpPlanUploadService;
import com.bbcare.followup.plat.store.ibatis.IDumpPlanUploadDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * 复旦儿科母乳上传登记Service业务层处理
 *
 * @author gxl
 * @date 2020-11-03
 */
@Service
public class DumpPlanUploadServiceImpl   implements IDumpPlanUploadService
{
    @Autowired
    private IDumpPlanUploadDao dumpPlanUploadMapper;
    @Autowired
    private IDumpMessageRecordService dumpMessageRecordService;

    /**
     * 查询复旦儿科母乳上传登记
     *
     * @param id 复旦儿科母乳上传登记ID
     * @return 复旦儿科母乳上传登记
     */
    @Override
    public DumpPlanUpload selectDumpPlanUploadById(String id)
    {
        return dumpPlanUploadMapper.selectDumpPlanUploadById(id);
    }

    /**
     * 查询复旦儿科母乳上传登记列表
     *
     * @param params 复旦儿科母乳上传登记
     * @return 复旦儿科母乳上传登记
     */
    @Override
    public List<DumpPlanUpload> selectDumpPlanUploadList(Map params)
    {
        return dumpPlanUploadMapper.selectDumpPlanUploadList(params);
    }

    /**
     * 新增复旦儿科母乳上传登记
     *
     * @param DumpPlanUpload 复旦儿科母乳上传登记
     * @return 结果
     */
    @Override
    public void insertDumpPlanUpload(DumpPlanUpload DumpPlanUpload)
    {
        DumpPlanUpload.setId(UUID.randomUUID().toString());
        DumpPlanUpload.setUploadTime(new Date());
        dumpPlanUploadMapper.insertDumpPlanUpload(DumpPlanUpload);
        dumpMessageRecordService.saveDumpMessageRecord(DumpPlanUpload);
    }

    /**
     * 修改复旦儿科母乳上传登记
     *
     * @param DumpPlanUpload 复旦儿科母乳上传登记
     * @return 结果
     */
    @Override
    public int updateDumpPlanUpload(DumpPlanUpload DumpPlanUpload)
    {
        return dumpPlanUploadMapper.updateDumpPlanUpload(DumpPlanUpload);
    }

    /**
     * 批量删除复旦儿科母乳上传登记
     *
     * @param ids 需要删除的复旦儿科母乳上传登记ID
     * @return 结果
     */
    @Override
    public int deleteDumpPlanUploadByIds(String[] ids)
    {
        return dumpPlanUploadMapper.deleteDumpPlanUploadByIds(ids);
    }

    /**
     * 删除复旦儿科母乳上传登记信息
     *
     * @param id 复旦儿科母乳上传登记ID
     * @return 结果
     */
    @Override
    public int deleteDumpPlanUploadById(String id)
    {
        return dumpPlanUploadMapper.deleteDumpPlanUploadById(id);
    }

    @Override
    public Integer selectCountDumpPlanUploadRecord(Map params) {
        return dumpPlanUploadMapper.selectCountDumpPlanUploadRecord(params);
    }




}
